<template>
	<view class="bgw">
		<view class="waitingItem" v-for="i in doctorsList" @click.stop="message(i.id)">
			<img v-if="i.avatar" :src="baseUrl+i.avatar" mode=""></img>
			<img v-else src="../static/bg/Myprescription1.png" mode=""></img>
			<view class="patientInfoWrap">
				<view class="info">
					<view class="left_info">
						{{i.name}}
						<text class="sex">{{i.keshi}}</text>
						<text>{{i.zhicheng}}</text>
					</view>
				</view>
				<view class="llness">擅长：{{i.sc}}</view>
				<view class="receive">
					<view class="receiveTreatment" @click.stop="guahao(i.id)">立即挂号</view>
					<!-- <view class="receiveTreatment">查看详情</view> -->
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		get_company_doctors
	} from '../request/api.js'
	export default {
		name: "tab4",
		data() {
			return {
				baseUrl:'',
				// 医生列表信息
				doctorsList:[]
			};
		},
		mounted() {
			this.baseUrl = getApp().globalData.baseUrlImg;
			this.getDoctors()
		},
		methods:{
			// 当前医馆医生
			getDoctors() {
				let param = {
					id:uni.getStorageSync('companyId')
				}
				get_company_doctors(param).then(res => {
					if (res.code === 200) {
						this.doctorsList = res.data
					}
				})
			},
			message(id){
				uni.navigateTo({
					url:'/pages/myinfo/myinfoDetail?id='+id
				})
			},
			guahao(id){
				uni.navigateTo({
					url:'/pages/guahao/guahao?id='+id
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.bgw {
		overflow: auto;
		.waitingItem {
			padding: 30upx;
			display: flex;
			box-sizing: border-box;
			
			img {
				width: 80upx;
				height: 80upx;
				margin-right: 28upx;
				flex-shrink: 0;
				border-radius: 50%;
			}

			.patientInfoWrap {
				flex: 1;
				.info {
					margin-bottom: 16upx;

					.left_info {
						font-size: 28upx;
						font-family: Source Han Sans CN;
						font-weight: bold;
						color: #414141;
						white-space: nowrap;

						.sex {
							padding: 0 24upx;
							margin: 0 24upx;
							border-left: 2upx solid #CCCCCC;
							border-right: 2upx solid #CCCCCC;
						}
					}
				}

				.llness {
					width: 550upx;
					font-size: 28upx;
					font-weight: 400;
					color: #414141;
					margin-bottom: 32upx;
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
				}

				.receive {
					display: flex;
					// justify-content: flex-end;

					.receiveTreatment {
						background: #FDF4F5;
						border: 2upx solid #F86C53;
						border-radius: 32upx;
						font-size: 28upx;
						font-family: Source Han Sans CN;
						font-weight: 400;
						color: #F86C53;
						text-align: center;
						width: 176upx;
						padding: 10upx 0;
						margin-right: 20upx;
					}
				}

			}


		}
	}
</style>
